#!/usr/bin/perl -w

use strict;

die "brca12_primer.pl <input.fastq>\n" unless $ARGV[0];


open FQ, '<', "$ARGV[0]";
open PRIMER5, '>', "brca12_primer5.txt";
open PRIMER3, '>', "brca12_primer3.txt";

my ($line_num, $sub_len_5, $sub_len_3) = (0, 21, 25);

while (<FQ>) {
	
	$line_num++;
	if ($line_num % 4 == 2 ) {
		chomp;
		print PRIMER5 substr($_, 0, $sub_len_5);
		print PRIMER5 "\n";
		print PRIMER3 substr($_, -$sub_len_3);
		print PRIMER3 "\n";
		
	}
}

close FQ;
close PRIMER5;
close PRIMER3;
